<template>
  <div class="app-container">


    <el-table
      v-loading="loading"
      :data="whiteList"
    >
      <el-table-column label="代理人姓名" align="center" prop="agentName" />
      <el-table-column label="代理人手机号" align="center" prop="agentMobile" />
      <el-table-column label="浏览数" align="center" prop="browseNum" />
      <el-table-column label="下单数" align="center" prop="orderNum" />
      <el-table-column label="已提现金额" align="center" prop="yesWithDrawPrice">
        <template slot-scope="scope">
          <span v-if="scope.row.yesWithDrawPrice">{{scope.row.yesWithDrawPrice}}</span>
          <span v-else>0</span>
        </template>
      </el-table-column>
      <el-table-column label="待提现金额" align="center" prop="usePrice">
        <template slot-scope="scope">
          <span v-if="scope.row.usePrice">{{scope.row.usePrice}}</span>
          <span v-else>0</span>
        </template>
      </el-table-column>
      
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

  </div>
</template>

<script>
import { showAgentOrderData } from "@/api/system/agent";
import { getToken } from "@/utils/auth";
export default {
  name: "White",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 后台导入用户白名单表格数据
      whiteList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        mobile: null,
        userName: null,
      },
      // 用户导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/cancel/userWhite/importDataVir",
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        mobile: [
          { required: true, message: "手机号不能为空", trigger: "blur" },
        ],
        userName: [
          { required: true, message: "用户姓名不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询后台导入用户白名单列表 */
    getList() {
      this.loading = true;
      showAgentOrderData(this.queryParams).then((response) => {
        this.whiteList = response.data;
        this.total = response.total;
        this.loading = false;
      });
    },
  
  },
};
</script>
